package ningbo.oop;

/**
 * @Author 宁铂
 * @Date 2021/7/8 17:06
 * @Version 1.0
 */
public class TestOOP {
    /** 本类用于面向对象第一天综合练习 */
    public static void main(String[] args) {

        Person person = new Person();
        person.setName("安吉拉");
        person.setAge(18);
        person.setGender("白富美");
        person.setHeight(1.68);
        person.setAddress("HongKong");

        System.out.println(person.getName());
        System.out.println(person.getAge());
        System.out.println(person.getAddress());
        System.out.println(person.getHeight());
        System.out.println(person.getGender());

        person.study();
    }
}

class Person{

    private String name;
    private String gender;
    private double height;
    private String address;
    private int age;


    private void eat(){
        System.out.println("干饭人,干饭魂~");
    }

    public void study(){
        System.out.println("保持学习的习惯~");
        eat();
    }


    /** 为属性提供get和set方法 */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}
